package com.css.fxfzysx.modules.vabStructure.constans;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;

//ci 三类
@Getter
@AllArgsConstructor
public enum BuildingSeismicResistanceEnum {

    BUILDING_SEISMIC_RESISTANCE1(1,"①符合建筑抗震设计规范（GBJ 11-89）"),
    BUILDING_SEISMIC_RESISTANCE2(2,"②符合《工业与民用建筑抗震设计规范（TJ11-78）》要求"),
    BUILDING_SEISMIC_RESISTANCE3(3,"③符合《工业与民用建筑抗震设计规范（TJ11-74）》要求，不符合②"),
    BUILDING_SEISMIC_RESISTANCE4(4,"④符合建筑抗震设计规范（GB50011）"),
    BUILDING_SEISMIC_RESISTANCE5(5,"⑤其他");



    private final Integer code;
    private final String name;


    public static String getByCode(Integer code){
        for (BuildingSeismicResistanceEnum value : BuildingSeismicResistanceEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.name;
            }
        }
        return null;
    }

    public static Integer getByName(String name){
        for (BuildingSeismicResistanceEnum value : BuildingSeismicResistanceEnum.values()) {
            if (value.getName().equals(name)) {
                return value.code;
            }
        }
        return null;
    }

}
